package day06;

public class Animal {
    private String name;

    private String type;

    public Animal(){
        System.out.println("Animal...");
    }

    public Animal(String name,String type){
        System.out.println("Animal(name,type)...");
        this.name = name;
        this.type = type;
    }

    public String getName(){
        return name;
    }

    public void setName(String name){
        this.name = name;
    }

    public String getType(){
        return type;
    }

    public void setType(String type){
        this.type = type;
    }

    @Override
    public String toString(){
        final StringBuilder sb = new StringBuilder("Animal{");
        sb.append("name='").append(name).append('\'');
        sb.append(",type='").append(type).append('\'');
        sb.append('}');
        return sb.toString();
    }

    public void sleep(){
        System.out.println("动物在睡觉...");
    }

    public void spark(){
        System.out.println("动物在叫...");
    }
}
